package com.danbay.cloud.device.api.service.electricmeter;

import com.danbay.cloud.device.api.dto.DeviceLoginDto;
import com.danbay.cloud.device.api.dto.DeviceLogoutDto;
import com.danbay.cloud.device.api.dto.DeviceRegDto;
import com.danbay.cloud.device.api.dto.electricmeter.EmConsumptionDto;
import com.danbay.cloud.device.api.dto.electricmeter.EmConsumptionQueryDto;
import com.danbay.cloud.device.api.dto.electricmeter.EmInfoDetailDto;
import com.danbay.cloud.device.api.dto.electricmeter.EmInfoBaseDto;
import com.danbay.framework.exception.BusinessException;
import com.danbay.framework.springnc.annotation.AutoController;
import com.danbay.framework.springnc.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;

@AutoController
@RequestMapping("/device-service/em")
public interface IEmService {

    /**
     * 水表注册，返回deviceId
     * @return
     */
    @RequestMapping("/register")
    String register(@RequestBody DeviceRegDto regDto)  throws BusinessException;

    /**
     * 水表上线
     * @param loginDto
     * @return
     */
    @RequestMapping("/login")
    int login(@RequestBody DeviceLoginDto loginDto);

    /**
     * 水表下线
     * @param logoutDto
     * @return
     */
    @RequestMapping("/logout")
    int logout(@RequestBody DeviceLogoutDto logoutDto);

    /**
     * 根据电表deviceId获取电表基本信息
     * @param deviceId
     * @return
     */
    @RequestMapping("/information")
    EmInfoBaseDto information(String deviceId) throws BusinessException;

    /**
     * 根据电表deviceId获取电表详细信息
     * @param deviceId
     * @return
     * @throws BusinessException
     */
    @RequestMapping("/detail")
    EmInfoDetailDto detail(String deviceId) throws BusinessException;

    /**
     * 用电明细查询
     * @param queryDto
     * @return
     */
    @RequestMapping("/consumption")
    EmConsumptionDto consumption(EmConsumptionQueryDto queryDto) throws BusinessException;
}
